home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr50
/
pbc22b.zip
/
PBC$BAS.ZIP
/
EWINDMAC.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-01-01
|
4KB
|
113 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1993 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
DECLARE SUB DelayV (BYVAL MilliSeconds%)
DECLARE SUB EXQPrintC (st$, BYVAL Row%, BYVAL Column%, BYVAL Fore%, BYVAL Back%)
DECLARE SUB UnCalcAttr (Foreground%, Background%, BYVAL VAttr%)
SUB EWindowManagerC (TopRow%, LeftCol%, BottomRow%, RightCol%, Frame%, Fore%, Back%, Grow%, Shade%, S1%, S2%, TitleFore%, Title$)
IF Grow% THEN
XD% = RightCol% - LeftCol% + 1
YD% = BottomRow% - TopRow% + 1
Y1% = TopRow% + YD% \ 2
X1% = LeftCol% + XD% \ 2
Y2% = BottomRow% - YD% \ 2
X2% = RightCol% - XD% \ 2
IF YD% > XD% THEN
XDelta% = 1
YDelta% = (YD% + XD% \ 2) \ XD%
IF YDelta% < 1 THEN YDelta% = 1
ELSE
YDelta% = 1
XDelta% = (XD% + YD% \ 2) \ YD%
IF XDelta% < 1 THEN XDelta% = 1
END IF
DO
Y1% = Y1% - YDelta%
IF Y1% < TopRow% THEN Y1% = TopRow%
X1% = X1% - XDelta%
IF X1% < LeftCol% THEN X1% = LeftCol%
Y2% = Y2% + YDelta%
IF Y2% > BottomRow% THEN Y2% = BottomRow%
X2% = X2% + XDelta%
IF X2% > RightCol% THEN X2% = RightCol%
GOSUB MakeWindow
IF Grow% > 0 THEN DelayV Grow%
LOOP UNTIL Y1% = TopRow% AND X1% = LeftCol% AND Y2% = BottomRow% AND X2% = RightCol%
ELSE
Y1% = TopRow%
X1% = LeftCol%
Y2% = BottomRow%
X2% = RightCol%
GOSUB MakeWindow
END IF
EXIT SUB
MakeWindow:
tmp% = X2% - X1% + 1
IF Frame% AND 1 THEN
TopSt$ = STRING$(tmp%, "─")
ELSE
TopSt$ = STRING$(tmp%, "═")
END IF
MidSt$ = SPACE$(tmp%)
BotSt$ = TopSt$
SELECT CASE Frame%
CASE 1
TopSt$ = "┌" + TopSt$ + "┐"
MidSt$ = "│" + MidSt$ + "│"
BotSt$ = "└" + BotSt$ + "┘"
CASE 2
TopSt$ = "╔" + TopSt$ + "╗"
MidSt$ = "║" + MidSt$ + "║"
BotSt$ = "╚" + BotSt$ + "╝"
CASE 3
TopSt$ = "╓" + TopSt$ + "╖"
MidSt$ = "║" + MidSt$ + "║"
BotSt$ = "╙" + BotSt$ + "╜"
CASE 4
TopSt$ = "╒" + TopSt$ + "╕"
MidSt$ = "│" + MidSt$ + "│"
BotSt$ = "╘" + BotSt$ + "╛"
CASE 5
TopSt$ = STRING$(tmp% + 2, "▄")
MidSt$ = "▌" + MidSt$ + "▐"
BotSt$ = STRING$(tmp% + 2, "▀")
CASE ELSE
TopSt$ = SPACE$(tmp% + 2)
MidSt$ = TopSt$
BotSt$ = TopSt$
END SELECT
Row% = Y1% - 1
Col% = X1% - 1
IF LEN(Title$) > 0 AND LEN(TopSt$) >= 4 THEN
St$ = LEFT$(Title$, LEN(TopSt$) - 4)
MID$(TopSt$, 2) = "[" + St$ + "]"
EXQPrintC TopSt$, Row%, Col%, Fore%, Back%
EXQPrintC St$, Row%, Col% + 2, TitleFore%, Back%
ELSE
EXQPrintC TopSt$, Row%, Col%, Fore%, Back%
END IF
FOR Row% = Y1% TO Y2%
EXQPrintC MidSt$, Row%, Col%, Fore%, Back%
NEXT
EXQPrintC BotSt$, Y2% + 1, Col%, Fore%, Back%
Col% = X1% - 3
IF Shade% THEN
UnCalcAttr SFore%, SBack%, Shade%
FOR Row% = Y1% TO Y2% + 1
EXQPrintC "░░", Row%, Col%, SFore%, SBack%
NEXT
EXQPrintC STRING$(X2% - X1% + 3, "░"), Y2% + 2, Col%, SFore%, SBack%
END IF
RETURN
END SUB